//+------------------------------------------------------------------+
//|                                                         0825.mq5 |
//|                                  Copyright 2023, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2023, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property indicator_separate_window
#property indicator_minimum -2
#property indicator_maximum 2
#property indicator_buffers 3
#property indicator_plots   3
//--- plot xian
#property indicator_label1  "xian"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrRed
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
//--- plot jiantou
#property indicator_label2  "jiantou"
#property indicator_type2   DRAW_ARROW
#property indicator_color2  clrYellow
#property indicator_style2  STYLE_SOLID
#property indicator_width2  1
//--- plot zhu
#property indicator_label3  "zhu"
#property indicator_type3   DRAW_HISTOGRAM
#property indicator_color3  clrWhite
#property indicator_style3  STYLE_SOLID
#property indicator_width3  1
//--- indicator buffers
double         xianBuffer[];
double         jiantouBuffer[];
double         zhuBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,xianBuffer,INDICATOR_DATA);
   SetIndexBuffer(1,jiantouBuffer,INDICATOR_DATA);
   SetIndexBuffer(2,zhuBuffer,INDICATOR_DATA);
//--- setting a code from the Wingdings charset as the property of PLOT_ARROW
   PlotIndexSetInteger(1,PLOT_ARROW,159);
   

//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
      xianBuffer[rates_total - 1] = 1;
      xianBuffer[rates_total - 2] = 1.1;
      
      jiantouBuffer[rates_total - 1] = 0.6;
      jiantouBuffer[rates_total - 2] = 1.2;
      
      zhuBuffer[rates_total - 1] = 0.6;
      zhuBuffer[rates_total - 2] = 1.2;
      
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
